package com.smithlibraties.util.core;

import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.world.World;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class Utils {

    public static Minecraft getMc(){
        return Minecraft.getMinecraft();
    }

    public static boolean isClient(){
        return Utils.getMc().theWorld.isRemote;
    }

    public boolean isClient(World world) {
        return world.isRemote;
    }

    public static World getWorld(){
        return Utils.getMc().theWorld;
    }

    public World getWorld(Minecraft mc) {
        return mc.theWorld;
    }

    public static EntityClientPlayerMP getPlayer(){
        return Utils.getMc().thePlayer;
    }

    public EntityClientPlayerMP getPlayer(Minecraft mc) {
        return mc.thePlayer;
    }

    public static TextureManager getRenderEngine(){
        return Utils.getMc().renderEngine;
    }

    public TextureManager getRenderEngine(Minecraft mc){
        return mc.renderEngine;
    }

    public static void mcPrint(String text){
        Logger logger = LogManager.getLogger();
        logger.info(text);
    }
}
